<?php
$page_title = "Spiral Scope";
$page_association = "visuals.php";
include("header.php");
$width = 300;
$height =  100;
$pixel = 1;
?>
<center><canvas id="canvas" width="<?php echo $width * $pixel; ?>" height="<?php echo $height * $pixel; ?>"></canvas></center>
<center><div id="error"></div></center>
<script language="javascript" type="text/javascript">

VisualsStop();

var count = 0;

width = <?php echo $width; ?>;
height = <?php echo $height; ?>;
pixel = <?php echo $pixel; ?>;
line_blend_mode = 2;
clearFrame = true;
drawMode = 0;
redraw = false;

var dm = 1;

function sscope_init() {
    n = 32;
    t = 0;
}

function sscope_init2() {
	n = 12;
	t = 0;
}

function sscope_init3() {
	n = 8;
	t = 0;
}

function sscope_frame() {
    t = t - 5;
}

function sscope_beat1() {
    drawMode = if2(drawMode, 0, 1);
	count = count + 4;
}

function sscope_beat2() {
	drawMode = if2(drawMode, 0, 1)
	count = count + 5;
}

function sscope_beat3() {
    drawMode = if2(drawMode, 0, 1);
    count = count + 6;
}

function sscope_point1() {
    d = i + v * .2;
    r = t + i*PI*count*100;
    x = Math.cos(r)*d*.8;
    y = Math.sin(r)*d*.8;
}

function sscope_point2() {
    d = i + v * .2;
    r = t + i*PI*count*100;
    x = Math.cos(r)*d*.8;
    y = Math.sin(r)*d*.8;
}

function sscope_point3() {
    d = i + v * .2;
    r = t + i*PI*count*100;
    x = Math.cos(r)*d*.8;
    y = Math.sin(r)*d*.8;
}

var scope1 = new r_sscope("Spiral Scope", sscope_init, sscope_frame, sscope_beat1, sscope_point1);
var scope2 = new r_sscope("Spiral Scope2", sscope_init2, sscope_frame, sscope_beat2, sscope_point2);
var scope3 = new r_sscope("Spiral Scope3", sscope_init3, sscope_frame, sscope_beat3, sscope_point3);
scope1.fgcolor = 0xffffffff;
scope2.fgcolor = 0xff00ff00
scope3.fgcolor = 0xff0000ff;
scope1.addvar("count", 0);
scope2.addvar("count", 5);
scope3.addvar("count", 10);
scope1.addvar("drawMode", 1);
scope2.addvar("drawMode", 0);
scope3.addvar("drawMode", 1);
var blur = new r_blur("Blur", 3, false);
AddLink(scope1);
AddLink(scope2);
AddLink(blur);
AddLink(scope3);
VisualsStart();
</script>
</body>
</html>

